package wode.controller;
import wode.entity.FightePlane;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;

public class PlaneController extends KeyAdapter {
    private FightePlane fightePlane;
    public PlaneController(FightePlane fightePlane){
        this.fightePlane=fightePlane;
    }
    public void keyPressed(KeyEvent e){
        direction(e.getKeyCode());
    }
    public void direction(int code){
        switch (code){
            case 37:
                fightePlane.x-=20;
                break;
            case 38:
                fightePlane.y-=20;
                break;      
            case 39:
                fightePlane.x+=20;
                break;
            case 40:
                fightePlane.y+=20;
                break;
        }
    }
}